﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Common.Service;
using SendLeaderMarking.Common.Interface;
using SendLeaderMarking.Common.Entity;

using System.Collections;

namespace SendLeaderMarking
{
    public partial class Marking : System.Web.UI.Page
    {
        IMarking marking = ServiceContainer.GetService<IMarking>();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["taskid"] != null)
                {
                    HistoryUserEntity hisMsg = marking.GetHistoryMsg(Request.QueryString["taskid"]);
                    if (hisMsg != null)
                    {
                        lUser.Text = hisMsg.CN_NAME;
                        lCommont.Text = hisMsg.COMMENTS;
                        lDate.Text = hisMsg.ACTION_DATE.ToString();
                    }
                    IList hisMsgList = marking.GetHistoryMsgList(Request.QueryString["taskid"]);
                    gvMarking.DataSource = hisMsgList;
                    gvMarking.DataBind();
                }
                else
                {
                    Response.Write("<script>alert('缺失参数');</script>");
                }
                if (Request.QueryString["usercode"] != null)
                {
                    IList ideaMsgList = marking.GetIdeaMsgList(Request.QueryString["usercode"]);
                    ddlNormalIdea.DataSource = ideaMsgList;
                    ddlNormalIdea.DataTextField = "SETTING_VALUE";
                    ddlNormalIdea.DataTextField = "SETTING_VALUE";
                    ddlNormalIdea.DataBind();
                    ddlNormalIdea.Items.Insert(0, "");
                }
            }
        }
    }
}